package com.springcloudlearning.chapter.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.feign.client.UserClient;
import com.github.pagehelper.PageInfo;
import com.service.base.ResponseResult;
import com.service.bean.UserDomain;
import com.springcloudlearning.chapter.service.UserService;

@RestController
public class UserController implements UserClient{

    @Autowired
    private UserService userService;

	@Override
	public ResponseResult getPage(
			@RequestParam("pageNumber") Integer pageNumber,
			@RequestParam("pageSize") Integer pageSize) {
		PageInfo<UserDomain> page = userService.selectUsers(pageNumber, pageSize);
  		return ResponseResult.ok(page);
	}
}

